package com.green.system.common;

import org.apache.shiro.crypto.hash.Md5Hash;

import java.util.UUID;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: Green
 * @Date: 2021/11/01/8:43
 * @Description:
 */

public class MD5Utils {

    /**
    * @Description: 生成UUID
    * @Param: []
    * @return: java.lang.String
    * @Author: Green
    * @Date: 2021/11/1
    */
    
    public static String createUUID(){
        return UUID.randomUUID().toString().replace("-","");
    }


    /**
    * @Description: 加密
    * @Param: [source, salt, hashIterations]
    * @return: java.lang.String
    * @Author: Green
    * @Date: 2021/11/1
    */
    
    public static String md5(String source,String salt,Integer hashIterations){
        Md5Hash hash = new Md5Hash(source,salt,hashIterations);
        return hash.toString();
    }
}
